#!/bin/bash
app_dir=./release-arm926/
app=wjc.elf
input=$1
op=$2
if [ ! -n "$1" ];then
	echo "input 100 or 400 or 600"
	exit
elif [ "$input" == "100" ];then
	target=pi2
elif [ "$input" == "400" ];then
	target=pi6
elif [ "$input" == "600" ];then
	target=pi7
fi

echo $target
export PATH=$PATH:/usr/local/arm/4.4.4/bin
#make DP=$target ARCH=armv7 $@ 2>compile_info.txt
make DP=$target ARCH=arm926 $op 2>compile_info.txt
#make DP=pi4 $@ 2>compile_info.txt
cat compile_info.txt | grep error
cat compile_info.txt | grep "错误"
cd $app_dir
pwd
if [ -e wjc-d.elf ];then
	rm wjc-d.elf
fi
if [ -e $app ];then
	echo strip $app
	cp wjc.elf  wjc-d.elf
	arm-linux-strip $app
	ls -lh
fi
